package com.example.boot6rabbitmqbalance.rabbitmq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RabbitmqSender {
    @Autowired
    private AmqpTemplate amqpTemplate;

    public void sendMessage(String exchange,String roukekey,String content) {
        try {
            amqpTemplate.convertAndSend(exchange, roukekey, content);
        }catch (Exception e) {

        }
    }
}
